import { useContext } from 'react';
import { AudioChatServiceContext } from '@/components/AudioChatServiceProvider/context';

export const useLogContent = () => {
  const { logContent, setLogContent } = useContext(AudioChatServiceContext);

  const log = (v: string) => {
    setLogContent(prevState => [...prevState, `[${new Date().toLocaleTimeString()}]\t${v}`]);
  };
  return {
    logContent,
    log,
  };
};
